package utils

import (
	"math/big"
	"net"
)

func IP6toInt(IPv6Address net.IP) int64 {
	IPv6Int := big.NewInt(0)

	// from http://golang.org/pkg/net/#pkg-constants
	// IPv6len = 16
	IPv6Int.SetBytes(IPv6Address.To16())
	return IPv6Int.Int64()
}
func IP4toInt(IPv4Address net.IP) int64 {
	IPv4Int := big.NewInt(0)
	IPv4Int.SetBytes(IPv4Address.To16())
	return IPv4Int.Int64()
}
